package Chapter3;

import java.util.Scanner;

public class Caishuzi {
    public static void main(String[] args) {
        //生成一个随机数
        int num = (int)(Math.random()*100);
        Scanner sc = new Scanner(System.in);
        boolean isRight = false;
        //不固定次数的循环用while
        //固定次数用 for
        while (isRight == false){
             int temp = sc.nextInt();
             if(temp == num){
                 System.out.println("猜对了");
                 break;
             }else if(temp < num){
                 System.out.println("小了");
                 continue;
             }else {
                 System.out.println("大了");
                 continue;
             }
        }
    }
}
